<h5>Sending data from Isadora to Wiring</h5>
<p>This tutorial introduces the basic interfacing between the Wiring hardware and Isadora <a href="http://www.troikatronix.com">http://www.troikatronix.com</a>. The brief for the tutorial will be to send values from Isadora to Wiring to turn ON or OFF the WIring board LED. It assumes the Wiring software and Isadora are installed and the proper Wiring setup has been previously completed. For more Information on Wiring install check out the <a href="http://wiring.org.co/learning/tutorials/">tutorials</a> about Wiring installation and software setup.</p>
<h5>Step 1</h5>
<p>Copy and paste the following code on the Wiring editor: Verify your program is free of compiling errors by pressing the Compile/Verify button in the menu bar. Press the Upload button in the menu bar. In case of syntax errors the Wiring environment will print the error messages otherwise it will print the Upload was completed successfully, the uploading process triggers activity in the Rx/Tx LEDs on the Wiring hardware. The new program will start automatically after uploading. Use the Serial Monitor button to watch the data coming from the Wiring board, then close the Serial Monitor again.</p>
<code>
<pre>
/**
 * Serial Read and Isadora
 * 
 * Demonstrates how to read data from the serial port. 
 * If the data received is an 'H', the light turns ON,
 * if it is an 'L', the light turns OFF. 
 */

int val;          // variable to receive data from the serial port
int ledpin = 48;  // Wiring board LED

void setup() 
{
  pinMode(ledpin, OUTPUT);  // pin 48 (on-board LED) as OUTPUT
  Serial.begin(9600);       // start serial communication at 9600bps
}

void loop() {
  if( Serial.available() )         // if data is available to read
  {
    val = Serial.read();           // read it and store it in 'val'
    if( val == 'H' )               // if 'H' was received
    {
      digitalWrite(ledpin, HIGH);  // turn ON the LED
    } 
    else if( val == 'L' ) { 
      digitalWrite(ledpin, LOW);   // otherwise turn it OFF
    }
  }
  delay(100);                      // wait 100ms for next reading
}
</pre>
</code>
<h5>&nbsp;</h5>
<h5>Step 2</h5>
<p>Next step is to setup things in Isadora. Start Isadora. In the &quot;Search&quot; box type Serial and find &quot;Serial In Watcher - Text&quot;, select it and drop the object on the main Isadora work area:</p>
<p><img src="imgs/Isadora-09.jpg" /></p>
<p>&nbsp;</p>
<h5>Step 3</h5>
<p>Double click on the first Send Serial Data object and a popup window will open, inside type the following small program:
<code>
<pre>"H"

</pre>
</code>
<p><img src="imgs/Isadora-10.jpg" /></p>
<p>&nbsp;</p>
<p>&quot;H&quot; is used to as thecharacter we are sending to Wiring.</p>
<p>&nbsp;</p>
<h5>Step 4</h5>
<p>Double click on the second Send Serial Data object, inside type the following small program: </p>
<pre><code>&quot;L&quot;

</code></pre>
<p><img src="imgs/Isadora-11.jpg" /></p>
<p>&nbsp;</p>
<p>&quot;L&quot; is used to as thecharacter we are sending to Wiring.</p>
<p>&nbsp;</p>
<h5>Step 5</h5>
<p>Go to the &quot;Output&quot; menu and select &quot;Serial Port Setup&quot;: </p>
<p><img src="imgs/Isadora-12.jpg"  /></p>
<p>&nbsp;</p>
<p>The Serial Port Setup  popup Window opens, click on the Select menu and select the Wiring board serial port, on Windows it will appear as COMx, where x must be the number assigned to the Wiring board, on macosx it will appear as usbserial-xxxxxxxx. The other settings can be left as the default, the Speed parameter will be left to 9600 since this is the speed used previously in the Wiring program on step 1 (Serial.begin(9600);). Click OK to close the dialog box to continue.</p>
<p>&nbsp;</p>
<h5>Step 6</h5>
<p>Go to the &quot;Output&quot; menu and select &quot;Enable Serial Ports&quot; this will activate the serial connection: </p>
<p><img src="imgs/Isadora-13.jpg" /></p>
<p>&nbsp;</p>
<p>Note the &quot;trigger&quot; field in the Send Serial Data object will send an &quot;H&quot; or an &quot;L&quot;when clicking on it:</p>
<p><img src="imgs/Isadora-09.jpg" /></p>
<p>&nbsp;</p>
<p>Interact with the Wiring board to turn ON and OFF the board LED by pressing the trigger field on each object. For more information about Isadora, check their forum at <a href="http://forum.troikatronix.com/">http://forum.troikatronix.com/</a>.</p>
